File Management
RAM - working memory and running configuration FLASH - Cisco IOS software ROM - bootstrap program and ROMMON NVRAM - startup configuration The flash is not on a disk because there are no moving parts and provides less chance for failure. Flash can be internal or external located on a flash card, USB stick or external TFTP server. Upgrade IOS Image You can use an external database or USB stick to load the new file to the router. Use the copy command: copy tftp flash There are many options after the copy command that specifies various other locations: R1#copy ? /erase Erase destination file system. /error Allow to copy error file. /noverify Don't verify image signature before reload. /verify Verify image signature before reload. archive: Copy from archive: file system cns: Copy from cns: file system flash: Copy from flash: file system ftp: Copy from ftp: file system http: Copy from http: file system https: Copy from https: file system ips-sdf Copy from current IPS signature configuration null: Copy from null: file system nvram: Copy from nvram: file system pram: Copy from pram: file system rcp: Copy from rcp: file system running-config Copy from current system configuration scp: Copy from scp: file system slot0: Copy from slot0: file system startup-config Copy from startup configuration system: Copy from system: file system tftp: Copy from tftp: file system xmodem: Copy from xmodem: file system ymodem: Copy from ymodem: file system Boot Sequence When a router first powers on, it follows these four steps: #The router performs a power-on self-test (POST) process to discover the hardware components and verify that all components work properly. #The router copies a bootstrap program from ROM into RAM and runs the bootstrap program. #The bootstrap program decides which IOS image (or other OS) to load into RAM and then the bootstrap program loads the OS. After loading the other OS image, the bootstrap program hands over control of the router hardware to the newly loaded OS. #If the bootstrap program loaded IOS (instead of some other OS), IOS finds the configuration file (usually the startup-config file in NVRAM) and loads it into RAM as the running-config. If one of the first two steps fail, better call TAC because that is internal processing. The last two steps are configurable. The Three OS's on the Router *IOS *ROM Monitor (ROMMON) - stored in ROM and used in old and new routers *Boot ROM (RxBoot, boot helper) - stored in ROM and used in only older routers You can recover passwords in ROMMON and troubleshoot the system. Configuration Register Before the router loads the IOS and read the startup-config file, the boot process reads the configuration register value. The value will determine boot-time variables like whether to load into ROMMON or not. config-register config-register 0x2100 - boot into ROMMON config-register 0x2102 - default, load an IOS image and console setting is set to 9600 baud rate config-register 0x2142 - ignore the startup-config file at load The router chooses the IOS to load based on the boot field bit in the config register (last bit) or the boot system command. #If boot field = 0, use the ROMMON OS. #If boot field = 1, load the first IOS file found in flash memory. #If boot field = 2-F: ##Try each boot system command in the startup-config file, in order, until one works ##If none of the boot system commands work, load the first IOS file found in flash memory. boot system flash boot system flash boot system tftp 10.0.1.1 The show version command will show information concerning the boot variables, IOS image and interfaces. show version #IOS Version #The uptime #The reason for the last reload of IOS #The time of the last loading of IOS #The source from which the router loaded the current IOS #The amount of RAM memory #The number and types of interfaces #The amount of NVRAM memory #The amount of flash memory #The configuration register's current and future setting Password Recovery You can bypass the startup-configuration file by entering config-register 0x2142 but you still need the enable password to get into the device. To get the routers (new) to load into ROMMON, remove the flash drives and boot the router. It will not load the config files and load up ROMMON mode. #Boot ROMMON, either by breaking into the boot process from the console or by first removing all the flash memory. #Set the configuration register to ignore the startup-config file (for example, 0x2142) #Boot the router with an IOS and now you can reach enable mode from the console without needing any passwords. Example #Turn the router power switch off #Carefully remove compact flash from the router #Turn the router power switch on #Watch initialization messages, waiting for the ROMMON> prompt. #Once the router is in ROMMON mode, with a ROMMON > prompt, carefully reinsert the compact flash. #Set the config register to 0x2142 using the ROMMON confreg 0x2142 command #Issue ROMMON reset command, which makes the router work through its normal reload process (including using the new configuration register value #Watch for IOS to ask you to enter setup mode, because IOS should load, but with no initial configuration #Log in from the console (no passwords required) and move into enable mode. This gets past all password checks but with no passwords requuired #Issue the copy startup-config running-config command to put all configuration back to its normal state so that the router begins doing its job again #Get into configuration mode and reset any forgotten passwords to new values #Issue the copy running-config startup-config command to save all the configuration, including changes to the passwords #Configure the configuration register back to its normal stable setting, usually 0x2102, so that the next time it reloads, the router does not load ROMMMON again Managing Configuration Files startup-config - stores initial configuration used any time the switch reloads IOS - stored in NVRAM running-config - stores the currently used config commands. This files changes dynamically when someone enters commands in config mode - stored in RAM When moving files from one place to another, depending on the location of the destination, different actions will happen. For example, if the destination is NVRAM, the file that was there previously is erased and replaced. If the destination is RAM, it does not replace the file and simply merges the config files together. This is good when the configuration isn't what you wanted so you can always load the startup config. Ways to erase the startup-config file write erase erase startup-config erase nvram: Other names for files: startup-config - nvram:startup-config running config - system:running-config Initial Configuration (Setup Mode) setup